package leaf.science.nav
{
	import flash.display.Sprite;
	import flash.events.Event;

	public class Page extends Sprite
	{
		public var onInComplete:Function = function():void{};
		public var onOutComplete:Function = function():void{};
		
		public function Page()
		{
			addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
		}

		override public function toString():String
		{
			return 'Page';
		}
		
		public function goIn():void
		{
		}
		
		public function goOut():void
		{
			onOutComplete();
		}
		
		public function onResize(evt:Event = null):void
		{
			x = int(stage.stageWidth / 2);
			y = int((stage.stageHeight-44) / 2) + 44;
		}
		
		protected function onAddedToStage (evt:Event):void
		{
			trace('Page:', this);
			goIn();
		}
		
		
		
	}
}